{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Preparing the Input for 12-lead"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/anaconda3/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:526: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n",
      "  _np_qint8 = np.dtype([(\"qint8\", np.int8, 1)])\n",
      "/anaconda3/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:527: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n",
      "  _np_quint8 = np.dtype([(\"quint8\", np.uint8, 1)])\n",
      "/anaconda3/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:528: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n",
      "  _np_qint16 = np.dtype([(\"qint16\", np.int16, 1)])\n",
      "/anaconda3/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:529: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n",
      "  _np_quint16 = np.dtype([(\"quint16\", np.uint16, 1)])\n",
      "/anaconda3/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:530: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n",
      "  _np_qint32 = np.dtype([(\"qint32\", np.int32, 1)])\n",
      "/anaconda3/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:535: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n",
      "  np_resource = np.dtype([(\"resource\", np.ubyte, 1)])\n",
      "/anaconda3/lib/python3.7/site-packages/dask/dataframe/utils.py:13: FutureWarning: pandas.util.testing is deprecated. Use the functions in the public API at pandas.testing instead.\n",
      "  import pandas.util.testing as tm\n"
     ]
    }
   ],
   "source": [
    "import os\n",
    "from sklearn.preprocessing import StandardScaler\n",
    "#import wfdb as wf\n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "from biosppy.signals import ecg\n",
    "import glob\n",
    "from scipy import signal\n",
    "import pandas as pd\n",
    "from tensorflow.python.keras.layers import Dense, Convolution1D, Convolution2D,MaxPool1D, Flatten, Dropout\n",
    "from tensorflow.python.keras.layers import Input\n",
    "from tensorflow.python.keras.models import Model\n",
    "from tensorflow.python.keras.layers.normalization import BatchNormalization\n",
    "import tensorflow.python.keras\n",
    "from tensorflow.python.keras.callbacks import EarlyStopping, ModelCheckpoint\n",
    "from tensorflow.python.keras.utils.np_utils import to_categorical\n",
    "import tensorflow as tf\n",
    "from sklearn.metrics import confusion_matrix\n",
    "from sklearn.model_selection import StratifiedShuffleSplit\n",
    "from collections import Counter\n",
    "from sklearn import preprocessing\n",
    "import pandas as pd\n",
    "import numpy as np\n",
    "import os,glob\n",
    "import math\n",
    "import fnmatch\n",
    "import re\n",
    "import gc\n",
    "import shutil\n",
    "from joblib import Parallel, delayed\n",
    "#import matplotlib.pyplot as plt\n",
    "import scipy.signal as scipysi\n",
    "import xgboost as xgb\n",
    "from sklearn.model_selection import StratifiedShuffleSplit\n",
    "from sklearn import metrics\n",
    "from sklearn.preprocessing import PolynomialFeatures\n",
    "from sklearn.ensemble import BaggingClassifier\n",
    "from sklearn.multiclass import OneVsRestClassifier\n",
    "from sklearn.multiclass import OneVsOneClassifier\n",
    "from sklearn.multiclass import OutputCodeClassifier\n",
    "from sklearn.ensemble import ExtraTreesClassifier\n",
    "from sklearn.neighbors import NearestCentroid\n",
    "from sklearn.neighbors import RadiusNeighborsClassifier\n",
    "from sklearn.linear_model import SGDClassifier\n",
    "from sklearn.linear_model import RidgeClassifier\n",
    "from sklearn.ensemble import GradientBoostingClassifier\n",
    "from sklearn import linear_model\n",
    "from sklearn.preprocessing import MinMaxScaler, MaxAbsScaler\n",
    "from sklearn.feature_selection import SelectFromModel\n",
    "import tensorflow as tf\n",
    "from tensorflow import keras\n",
    "from tensorflow.keras.layers import Bidirectional, GRU\n",
    "import shutil\n",
    "#import matplotlib as plt\n",
    "from tensorflow.python.keras.models import Model\n",
    "from tensorflow.python.keras.layers import Input, Dense, LSTM, multiply, concatenate, Activation, Masking, Reshape,CuDNNLSTM,GlobalMaxPooling1D, MaxPool2D,Flatten\n",
    "from tensorflow.python.keras.layers import Conv1D, Conv2D, BatchNormalization, GlobalAveragePooling1D, Permute, Dropout, GlobalAveragePooling2D,Concatenate\n",
    "from tensorflow import keras\n",
    "from tensorflow.keras import layers\n",
    "import numpy as np\n",
    "from imblearn.over_sampling import SMOTE, ADASYN, SVMSMOTE\n",
    "from sklearn import preprocessing\n",
    "from sklearn.ensemble import RandomForestClassifier\n",
    "from tensorflow.keras import initializers\n",
    "from tensorflow.keras import regularizers, constraints\n",
    "import tensorflow.keras.backend as K\n",
    "\n",
    "\n",
    "from sklearn.decomposition import PCA\n",
    "from mpl_toolkits.mplot3d import Axes3D\n",
    "from matplotlib.colors import ListedColormap\n",
    "\n",
    "from scipy import signal\n",
    "from scipy.fft import fftshift"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Loading data and playing with it"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "#constants\n",
    "\n",
    "TARGET_SAMPLING_RATE=250\n",
    "DATA_SAMPLING_RATE=500\n",
    "INPUT_BEAT_SIZE=300\n",
    "\n",
    "#paths\n",
    "root_path='/Users/aring/Desktop/ECG-identification/Arnold-data'\n",
    "\n",
    "DataFilePath = root_path+'/NoiseReductionData/'\n",
    "LeadInfoFilePath = root_path+'/DiagnosisFiles/MissingLeadInfo/'\n",
    "RepDiagnosisFileName = root_path+'/DiagnosisFiles/RepatTranslationDiagAfterRemDupAndBDQ_CHS20200531_ToArinG.xlsx'\n",
    "FullDiagnosisFileName = root_path+'/DiagnosisFiles/TranslationDiagAfterRemDupAndBDQ_CHS20200531_ToArinG.xlsx'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>FileName</th>\n",
       "      <th>PatientID</th>\n",
       "      <th>DOB</th>\n",
       "      <th>Age</th>\n",
       "      <th>Gen</th>\n",
       "      <th>TimeAcquisition</th>\n",
       "      <th>Translation</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>MUSE_20180113_180130_23000</td>\n",
       "      <td>219</td>\n",
       "      <td>1011931.0</td>\n",
       "      <td>85</td>\n",
       "      <td>Male</td>\n",
       "      <td>29/12/2016 10:52:16</td>\n",
       "      <td>['Sinus_Tachycardia']</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>MUSE_20180113_180131_30000</td>\n",
       "      <td>219</td>\n",
       "      <td>1011931.0</td>\n",
       "      <td>86</td>\n",
       "      <td>Male</td>\n",
       "      <td>29/05/2017 10:10:54</td>\n",
       "      <td>['Sinus_Tachycardia']</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>MUSE_20180113_180139_35000</td>\n",
       "      <td>219</td>\n",
       "      <td>1011931.0</td>\n",
       "      <td>86</td>\n",
       "      <td>Male</td>\n",
       "      <td>03/06/2017 07:34:27</td>\n",
       "      <td>['Sinus_Tachycardia']</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>MUSE_20180113_180143_59000</td>\n",
       "      <td>219</td>\n",
       "      <td>1011931.0</td>\n",
       "      <td>86</td>\n",
       "      <td>Male</td>\n",
       "      <td>04/11/2017 11:46:50</td>\n",
       "      <td>['Sinus_Tachycardia']</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>MUSE_20180113_131105_22000</td>\n",
       "      <td>542</td>\n",
       "      <td>1011931.0</td>\n",
       "      <td>86</td>\n",
       "      <td>Female</td>\n",
       "      <td>26/01/2017 12:50:33</td>\n",
       "      <td>[ 'Ventricular_Escape_Beat']</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>95</th>\n",
       "      <td>MUSE_20180116_131237_15000</td>\n",
       "      <td>105952</td>\n",
       "      <td>1011936.0</td>\n",
       "      <td>80</td>\n",
       "      <td>Male</td>\n",
       "      <td>20/05/2016 09:08:08</td>\n",
       "      <td>['Atrial_Fibrillation', 'Pacemaker_ECG', 'Pace...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>96</th>\n",
       "      <td>MUSE_20180116_131235_03000</td>\n",
       "      <td>105952</td>\n",
       "      <td>1011936.0</td>\n",
       "      <td>81</td>\n",
       "      <td>Male</td>\n",
       "      <td>17/01/2017 11:11:45</td>\n",
       "      <td>['Atrial_Fibrillation']</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>97</th>\n",
       "      <td>MUSE_20180116_131239_26000</td>\n",
       "      <td>105952</td>\n",
       "      <td>1011936.0</td>\n",
       "      <td>80</td>\n",
       "      <td>Male</td>\n",
       "      <td>16/03/2016 19:09:09</td>\n",
       "      <td>['Atrial_Fibrillation']</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>98</th>\n",
       "      <td>MUSE_20180116_131240_34000</td>\n",
       "      <td>105952</td>\n",
       "      <td>1011936.0</td>\n",
       "      <td>81</td>\n",
       "      <td>Male</td>\n",
       "      <td>23/07/2017 08:52:27</td>\n",
       "      <td>['Atrial_Fibrillation']</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>99</th>\n",
       "      <td>MUSE_20180114_072910_38000</td>\n",
       "      <td>109030</td>\n",
       "      <td>1011942.0</td>\n",
       "      <td>75</td>\n",
       "      <td>Male</td>\n",
       "      <td>28/03/2017 00:13:49</td>\n",
       "      <td>['Atrial_Fibrillation', 'Pacemaker_ECG', 'Pace...</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>100 rows × 7 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                      FileName  PatientID        DOB Age     Gen  \\\n",
       "0   MUSE_20180113_180130_23000        219  1011931.0  85    Male   \n",
       "1   MUSE_20180113_180131_30000        219  1011931.0  86    Male   \n",
       "2   MUSE_20180113_180139_35000        219  1011931.0  86    Male   \n",
       "3   MUSE_20180113_180143_59000        219  1011931.0  86    Male   \n",
       "4   MUSE_20180113_131105_22000        542  1011931.0  86  Female   \n",
       "..                         ...        ...        ...  ..     ...   \n",
       "95  MUSE_20180116_131237_15000     105952  1011936.0  80    Male   \n",
       "96  MUSE_20180116_131235_03000     105952  1011936.0  81    Male   \n",
       "97  MUSE_20180116_131239_26000     105952  1011936.0  80    Male   \n",
       "98  MUSE_20180116_131240_34000     105952  1011936.0  81    Male   \n",
       "99  MUSE_20180114_072910_38000     109030  1011942.0  75    Male   \n",
       "\n",
       "        TimeAcquisition                                        Translation  \n",
       "0   29/12/2016 10:52:16                              ['Sinus_Tachycardia']  \n",
       "1   29/05/2017 10:10:54                              ['Sinus_Tachycardia']  \n",
       "2   03/06/2017 07:34:27                              ['Sinus_Tachycardia']  \n",
       "3   04/11/2017 11:46:50                              ['Sinus_Tachycardia']  \n",
       "4   26/01/2017 12:50:33                       [ 'Ventricular_Escape_Beat']  \n",
       "..                  ...                                                ...  \n",
       "95  20/05/2016 09:08:08  ['Atrial_Fibrillation', 'Pacemaker_ECG', 'Pace...  \n",
       "96  17/01/2017 11:11:45                            ['Atrial_Fibrillation']  \n",
       "97  16/03/2016 19:09:09                            ['Atrial_Fibrillation']  \n",
       "98  23/07/2017 08:52:27                            ['Atrial_Fibrillation']  \n",
       "99  28/03/2017 00:13:49  ['Atrial_Fibrillation', 'Pacemaker_ECG', 'Pace...  \n",
       "\n",
       "[100 rows x 7 columns]"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "RepDiagnosisDF = pd.read_excel(RepDiagnosisFileName)\n",
    "RepDiagnosisDF.head(n=100)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(8980, 7)"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "RepDiagnosisDF.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>FileName</th>\n",
       "      <th>PatientID</th>\n",
       "      <th>DOB</th>\n",
       "      <th>Age</th>\n",
       "      <th>Gen</th>\n",
       "      <th>TimeAcquisition</th>\n",
       "      <th>Translation</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>MUSE_20180115_124154_98000</td>\n",
       "      <td>880947374</td>\n",
       "      <td>1012016.0</td>\n",
       "      <td>20</td>\n",
       "      <td>Female</td>\n",
       "      <td>25/09/2017 15:32:26</td>\n",
       "      <td>[  'Sinus_Tachycardia']</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>MUSE_20180112_071158_01000</td>\n",
       "      <td>880957431</td>\n",
       "      <td>1012016.0</td>\n",
       "      <td>22</td>\n",
       "      <td>Female</td>\n",
       "      <td>16/11/2017 15:55:09</td>\n",
       "      <td>[  'Sinus_Tachycardia']</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>MUSE_20180114_123835_64000</td>\n",
       "      <td>880878772</td>\n",
       "      <td>1011949.0</td>\n",
       "      <td>67</td>\n",
       "      <td>Female</td>\n",
       "      <td>26/10/2016 10:55:48</td>\n",
       "      <td>[ 'Clockwise_Rotation', 'Complete_LBBB', 'Sinu...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>MUSE_20180210_124733_04000</td>\n",
       "      <td>2968425</td>\n",
       "      <td>1011949.0</td>\n",
       "      <td>68</td>\n",
       "      <td>Male</td>\n",
       "      <td>04/11/2017 19:30:02</td>\n",
       "      <td>[ 'Clockwise_Rotation', 'Myocardial_Infarction...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>MUSE_20180118_173322_76000</td>\n",
       "      <td>10956457</td>\n",
       "      <td>1011952.0</td>\n",
       "      <td>65</td>\n",
       "      <td>Female</td>\n",
       "      <td>10/05/2017 10:35:22</td>\n",
       "      <td>[ 'Clockwise_Rotation', 'Sinus_Tachycardia']</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>45303</th>\n",
       "      <td>MUSE_20180116_121305_58000</td>\n",
       "      <td>880938543</td>\n",
       "      <td>1011981.0</td>\n",
       "      <td>36</td>\n",
       "      <td>Male</td>\n",
       "      <td>15/08/2017 16:32:00</td>\n",
       "      <td>['VT']</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>45304</th>\n",
       "      <td>MUSE_20180120_123539_01000</td>\n",
       "      <td>880968276</td>\n",
       "      <td>1011988.0</td>\n",
       "      <td>30</td>\n",
       "      <td>Female</td>\n",
       "      <td>16/01/2018 18:06:02</td>\n",
       "      <td>['VT']</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>45305</th>\n",
       "      <td>MUSE_20180120_122254_36000</td>\n",
       "      <td>10183314</td>\n",
       "      <td>1012010.0</td>\n",
       "      <td>6</td>\n",
       "      <td>Female</td>\n",
       "      <td>23/11/2016 20:19:05</td>\n",
       "      <td>['Wandering_Pacemakerwithin_Sinoatrial_Node']</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>45306</th>\n",
       "      <td>MUSE_20180116_124311_28000</td>\n",
       "      <td>11106793</td>\n",
       "      <td>1011938.0</td>\n",
       "      <td>78</td>\n",
       "      <td>Female</td>\n",
       "      <td>16/01/2016 11:41:35</td>\n",
       "      <td>['Wandering_Pacemakerwithin_Sinoatrial_Node']</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>45307</th>\n",
       "      <td>MUSE_20180119_180042_46000</td>\n",
       "      <td>880832808</td>\n",
       "      <td>1011967.0</td>\n",
       "      <td>49</td>\n",
       "      <td>Male</td>\n",
       "      <td>09/03/2016 08:53:37</td>\n",
       "      <td>['Wandering_Pacemakerwithin_Sinoatrial_Node']</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>45308 rows × 7 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                         FileName  PatientID        DOB Age     Gen  \\\n",
       "0      MUSE_20180115_124154_98000  880947374  1012016.0  20  Female   \n",
       "1      MUSE_20180112_071158_01000  880957431  1012016.0  22  Female   \n",
       "2      MUSE_20180114_123835_64000  880878772  1011949.0  67  Female   \n",
       "3      MUSE_20180210_124733_04000    2968425  1011949.0  68    Male   \n",
       "4      MUSE_20180118_173322_76000   10956457  1011952.0  65  Female   \n",
       "...                           ...        ...        ...  ..     ...   \n",
       "45303  MUSE_20180116_121305_58000  880938543  1011981.0  36    Male   \n",
       "45304  MUSE_20180120_123539_01000  880968276  1011988.0  30  Female   \n",
       "45305  MUSE_20180120_122254_36000   10183314  1012010.0   6  Female   \n",
       "45306  MUSE_20180116_124311_28000   11106793  1011938.0  78  Female   \n",
       "45307  MUSE_20180119_180042_46000  880832808  1011967.0  49    Male   \n",
       "\n",
       "           TimeAcquisition                                        Translation  \n",
       "0      25/09/2017 15:32:26                            [  'Sinus_Tachycardia']  \n",
       "1      16/11/2017 15:55:09                            [  'Sinus_Tachycardia']  \n",
       "2      26/10/2016 10:55:48  [ 'Clockwise_Rotation', 'Complete_LBBB', 'Sinu...  \n",
       "3      04/11/2017 19:30:02  [ 'Clockwise_Rotation', 'Myocardial_Infarction...  \n",
       "4      10/05/2017 10:35:22       [ 'Clockwise_Rotation', 'Sinus_Tachycardia']  \n",
       "...                    ...                                                ...  \n",
       "45303  15/08/2017 16:32:00                                             ['VT']  \n",
       "45304  16/01/2018 18:06:02                                             ['VT']  \n",
       "45305  23/11/2016 20:19:05      ['Wandering_Pacemakerwithin_Sinoatrial_Node']  \n",
       "45306  16/01/2016 11:41:35      ['Wandering_Pacemakerwithin_Sinoatrial_Node']  \n",
       "45307  09/03/2016 08:53:37      ['Wandering_Pacemakerwithin_Sinoatrial_Node']  \n",
       "\n",
       "[45308 rows x 7 columns]"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "FullDiagnosisDF = pd.read_excel(FullDiagnosisFileName)\n",
    "FullDiagnosisDF"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(45308, 7)"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "FullDiagnosisDF.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Var1</th>\n",
       "      <th>Var2</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   Var1   Var2\n",
       "0  True  False\n",
       "1  True  False\n",
       "2  True  False\n",
       "3  True  False\n",
       "4  True  False"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "leadinfoDF = pd.read_excel(LeadInfoFilePath + 'MUSE_20180111_170356_27000' + '.xlsx')\n",
    "leadinfoDF.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(12, 2)"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "leadinfoDF.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>0</th>\n",
       "      <th>1</th>\n",
       "      <th>2</th>\n",
       "      <th>3</th>\n",
       "      <th>4</th>\n",
       "      <th>5</th>\n",
       "      <th>6</th>\n",
       "      <th>7</th>\n",
       "      <th>8</th>\n",
       "      <th>9</th>\n",
       "      <th>10</th>\n",
       "      <th>11</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>-44.944</td>\n",
       "      <td>-16.279</td>\n",
       "      <td>8.5933</td>\n",
       "      <td>25.355</td>\n",
       "      <td>-26.101</td>\n",
       "      <td>-6.0976</td>\n",
       "      <td>-51.235</td>\n",
       "      <td>-57.090</td>\n",
       "      <td>-45.905</td>\n",
       "      <td>-54.620</td>\n",
       "      <td>-21.231</td>\n",
       "      <td>14.0490</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>-50.910</td>\n",
       "      <td>-22.374</td>\n",
       "      <td>8.6467</td>\n",
       "      <td>31.734</td>\n",
       "      <td>-28.214</td>\n",
       "      <td>-8.6359</td>\n",
       "      <td>-51.259</td>\n",
       "      <td>-60.730</td>\n",
       "      <td>-49.903</td>\n",
       "      <td>-57.047</td>\n",
       "      <td>-24.873</td>\n",
       "      <td>7.9470</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>-57.153</td>\n",
       "      <td>-29.420</td>\n",
       "      <td>8.0254</td>\n",
       "      <td>38.785</td>\n",
       "      <td>-30.269</td>\n",
       "      <td>-12.1520</td>\n",
       "      <td>-51.659</td>\n",
       "      <td>-64.809</td>\n",
       "      <td>-53.887</td>\n",
       "      <td>-59.625</td>\n",
       "      <td>-29.008</td>\n",
       "      <td>1.6642</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>-63.350</td>\n",
       "      <td>-37.508</td>\n",
       "      <td>6.3144</td>\n",
       "      <td>46.402</td>\n",
       "      <td>-31.999</td>\n",
       "      <td>-16.9680</td>\n",
       "      <td>-52.452</td>\n",
       "      <td>-69.387</td>\n",
       "      <td>-57.537</td>\n",
       "      <td>-62.235</td>\n",
       "      <td>-33.709</td>\n",
       "      <td>-4.5832</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>-68.634</td>\n",
       "      <td>-45.746</td>\n",
       "      <td>3.5399</td>\n",
       "      <td>53.644</td>\n",
       "      <td>-33.037</td>\n",
       "      <td>-22.5800</td>\n",
       "      <td>-53.271</td>\n",
       "      <td>-74.064</td>\n",
       "      <td>-60.240</td>\n",
       "      <td>-64.508</td>\n",
       "      <td>-38.522</td>\n",
       "      <td>-10.1500</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       0       1       2       3       4        5       6       7       8   \\\n",
       "0 -44.944 -16.279  8.5933  25.355 -26.101  -6.0976 -51.235 -57.090 -45.905   \n",
       "1 -50.910 -22.374  8.6467  31.734 -28.214  -8.6359 -51.259 -60.730 -49.903   \n",
       "2 -57.153 -29.420  8.0254  38.785 -30.269 -12.1520 -51.659 -64.809 -53.887   \n",
       "3 -63.350 -37.508  6.3144  46.402 -31.999 -16.9680 -52.452 -69.387 -57.537   \n",
       "4 -68.634 -45.746  3.5399  53.644 -33.037 -22.5800 -53.271 -74.064 -60.240   \n",
       "\n",
       "       9       10       11  \n",
       "0 -54.620 -21.231  14.0490  \n",
       "1 -57.047 -24.873   7.9470  \n",
       "2 -59.625 -29.008   1.6642  \n",
       "3 -62.235 -33.709  -4.5832  \n",
       "4 -64.508 -38.522 -10.1500  "
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sample_record = pd.read_csv(DataFilePath + 'NoiseReductionData1/'+'MUSE_20180112_070939_20000' + '.csv', header=None)\n",
    "sample_record.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(5000, 12)"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sample_record.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "19\n",
      "300\n"
     ]
    }
   ],
   "source": [
    "channel = sample_record[0].values\n",
    "ecg_info_extracted = ecg.ecg(signal=channel, sampling_rate=DATA_SAMPLING_RATE, show=False)\n",
    "num_of_beats=ecg_info_extracted['templates'].shape[0]\n",
    "beat_size=ecg_info_extracted['templates'].shape[1]\n",
    "print(num_of_beats)\n",
    "print(beat_size)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(19, 300)"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "heart_beats_12lead = np.array(ecg_info_extracted['templates'], dtype=np.float)\n",
    "heart_beats_12lead.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(19, 600)"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "channel = sample_record[1].values\n",
    "ecg_info_extracted = ecg.ecg(signal=channel, sampling_rate=DATA_SAMPLING_RATE, show=False)\n",
    "heart_beats_12lead=np.append(heart_beats_12lead,ecg_info_extracted['templates'],1)\n",
    "heart_beats_12lead.shape\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "has all leads!\n"
     ]
    }
   ],
   "source": [
    "if any(~leadinfoDF.iloc[:, 0]):\n",
    "    print('missing some leaseds!')\n",
    "else:\n",
    "     print('has all leads!')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(19, 3600)"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#this creates a matrix where  each row is a beat, 12 leads stored one after another in that row (each lead is 300 smaples)\n",
    "for i in [1,0,2,3,4,5,6,7,8,9,10,11]:\n",
    "    channel = sample_record[i].values\n",
    "    try:\n",
    "        ecg_info_extracted = ecg.ecg(signal=channel, sampling_rate=DATA_SAMPLING_RATE, show=False)\n",
    "        if i==1:\n",
    "            heart_beats_12lead = np.array(ecg_info_extracted['templates'], dtype=np.float)\n",
    "            lead1_beats=ecg_info_extracted['templates']\n",
    "        else:\n",
    "            heart_beats_12lead = np.append(heart_beats_12lead,ecg_info_extracted['templates'],1)\n",
    "    except Exception as e:\n",
    "        if i==1:\n",
    "            break\n",
    "        print('error in processing the leads:'+ str(i))\n",
    "        heart_beats_12lead = np.append(heart_beats_12lead,np.zeros_like(lead1_beats),1)\n",
    "        continue\n",
    "\n",
    "\n",
    "heart_beats_12lead.shape\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(19, 300)"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ecg_info_extracted['templates'].shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[-18.13456949, -17.62687377, -17.08459724, ..., -20.57877766,\n",
       "        -23.10124215, -25.19957523],\n",
       "       [-17.13388225, -16.28698359, -15.31613171, ..., -21.90872581,\n",
       "        -23.85870663, -24.6684356 ],\n",
       "       [-13.35416922, -13.0744338 , -12.77143781, ..., -17.46681087,\n",
       "        -19.04744205, -21.00455269],\n",
       "       ...,\n",
       "       [-14.77531711, -14.28855901, -13.87134876, ..., -18.76016624,\n",
       "        -18.4452355 , -19.0769272 ],\n",
       "       [-13.35531235, -12.73198025, -12.17661534, ...,  -7.53141091,\n",
       "         -8.95909886, -10.90518262],\n",
       "       [-14.32165088, -13.3106402 , -12.43055031, ..., -11.62177154,\n",
       "        -12.16643547, -13.23792191]])"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "heart_beats_12lead[:,2*300:3*300]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(12, 300)"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "beat1_12lead = np.reshape(heart_beats_12lead[0], (12, 300))\n",
    "beat1_12lead.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYkAAAD8CAYAAACCRVh7AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAAIABJREFUeJzs3XeYXNVh///3uWV62Zlt2r7qXQgkhBBFohgM7sbdwRjsYBznFyexU5zmJHZiJ9/EcUlsQtzAIbEBmxhTDDKmCiGxoqh3rba32d3pc+v5/TGLAIPAYNAIc17Ps8/u3Dn3zpmdO/OZU+69QkqJoiiKorwQrdYVUBRFUU5eKiQURVGU41IhoSiKohyXCglFURTluFRIKIqiKMelQkJRFEU5LhUSiqIoynGpkFAURVGOS4WEoiiKclxGrSvwm2poaJDd3d21roaiKMrryrZt2yaklI0vVe51HxLd3d309PTUuhqKoiivK0KIo79OOdXdpCiKohyXCglFURTluFRIKIqiKMelQkJRFEU5LhUSiqIoynGpkFAURVGOS4WEoiiKclwqJJSTyi0jkwxU7FpXQ1GUGa/7g+mU3x4TlsPv7+kDYM/Zy0iZavdUlFpTLQnlpLE/23/s7/8eytSwJoqiPE2FhHLSOJAdOPZ3f8WqYU0URXmaCgnlpHG4MAlAkxxhsKhaEopyMlCdvspJo7dskWKaJkYYrkRrXR1FUVAtCeUkMmDrtBoV0qLAhKu+vyjKyUCFhHJS8LwKI36SjqCgXreY9AJIKWtdLUV5w1MhoZwUCpVxJqmnM2TSYLi46Ew6Xq2rpShveCoklJPCWHkSKTSagwEajWoLYsx2alwrRVFUSCgnhYyVA6A+GKYpoAMwqkJCUWpOjQ4qJ4WMVQDipIMJzGAAgFFLhYSi1JpqSSgnhUmrDEBDKEFLKALAcKVUyyopioJqSSgniSm7AkB9MIkZTGFKmylLhYSi1JoKCeWkMO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s55/zPxm05ANy40vU/rS2vIRqWeBLYHT9uqsdrc4a21N21AbYDT8R1fhr4XFy+mSiQ9QJ/D3hxeTL+ujc+vnmpddAV10oppaq6EIeblFJKLZAGCaWUUlVpkFBKKVWVBgmllFJVaZBQSilVlQYJpZRSVWmQUEopVZUGCaWUUlX9f09HgnQTk+okAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "#draw all 12 leads for the first beat\n",
    "for i in range(0,11):\n",
    "    plt.plot( beat1_12lead[i,:]) \n",
    "\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(12, 301)\n"
     ]
    }
   ],
   "source": [
    "#add the lalber to each row for each beat\n",
    "beat1_12lead\n",
    "num_patientID=123\n",
    "label_column = np.repeat(num_patientID, beat1_12lead.shape[0])\n",
    "label_column=np.reshape(label_column, (label_column.shape[0], 1))\n",
    "beat1_12lead_with_label=np.append(beat1_12lead,label_column,1)\n",
    "print(beat1_12lead_with_label.shape)\n",
    "# print(beat1_12lead_with_label[0,])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Preprocssing 12-lead data and Storing the input to NN"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [],
   "source": [
    "\n",
    "\n",
    "def generate_12lead_input_for_NN(num_patientID, diagnosis, signalFile):\n",
    "    NoiseReductionData_dirs=['NoiseReductionData1','NoiseReductionData2','NoiseReductionData3','NoiseReductionData4','NoiseReductionData5','NoiseReductionData6']\n",
    "    path_does_not_Exist=True\n",
    "    for dir_name in NoiseReductionData_dirs:\n",
    "        path = DataFilePath + dir_name+'/'+ signalFile + '.csv'\n",
    "        if os.path.exists(path):\n",
    "            path_does_not_Exist=False\n",
    "            break;\n",
    "    if path_does_not_Exist:\n",
    "        print('File does not exist:', signalFile)\n",
    "        return np.repeat(None, 1)\n",
    "    \n",
    "    all_beats_12lead_with_label_diagnosis = np.empty((0,12,INPUT_BEAT_SIZE+2), dtype=np.float)\n",
    "    record = pd.read_csv(path, header=None)\n",
    "    leadinfoDF = pd.read_excel(LeadInfoFilePath + signalFile + '.xlsx')\n",
    "    \n",
    "    for i in [1,0,2,3,4,5,6,7,8,9,10,11]:\n",
    "        channel = record[i].values\n",
    "        try:\n",
    "            ecg_info_extracted = ecg.ecg(signal=channel, sampling_rate=DATA_SAMPLING_RATE, show=False)\n",
    "            if i==1:\n",
    "                heart_beats_12lead = np.array(ecg_info_extracted['templates'], dtype=np.float)\n",
    "                lead1_beats=ecg_info_extracted['templates']\n",
    "                num_of_beats=lead1_beats.shape[0]\n",
    "            else:\n",
    "                heart_beats_12lead = np.append(heart_beats_12lead,ecg_info_extracted['templates'],1)\n",
    "        except Exception as e:\n",
    "            if i==1:\n",
    "                return np.repeat(None, 1)\n",
    "            else:\n",
    "                heart_beats_12lead = np.append(heart_beats_12lead,np.zeros_like(lead1_beats),1)\n",
    "                \n",
    "    for i in range(0,num_of_beats):\n",
    "        one_beat_12lead = np.reshape(heart_beats_12lead[i], (12, 300))\n",
    "        label_column = np.repeat(num_patientID, one_beat_12lead.shape[0])\n",
    "        label_column=np.reshape(label_column, (label_column.shape[0], 1))\n",
    "        diagnosis_column=np.repeat(diagnosis, one_beat_12lead.shape[0])\n",
    "        diagnosis_column=np.reshape(diagnosis_column, (diagnosis_column.shape[0], 1))\n",
    "        one_beat_12lead_with_label = np.append(one_beat_12lead,label_column,1)\n",
    "        one_beat_12lead_with_label_diagnosis = np.append(one_beat_12lead_with_label,diagnosis_column,1)\n",
    "        one_beat_12lead_with_label_diagnosis = np.reshape(one_beat_12lead_with_label_diagnosis,(1,12,302))\n",
    "        all_beats_12lead_with_label_diagnosis=np.vstack((all_beats_12lead_with_label_diagnosis,one_beat_12lead_with_label_diagnosis))\n",
    "    \n",
    "\n",
    "    return all_beats_12lead_with_label_diagnosis\n",
    "\n",
    "   "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [],
   "source": [
    "x=generate_12lead_input_for_NN(123,['Sinus_Tachycardia'],'MUSE_20180111_170356_27000')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([['-40.719956926829624', '-40.844754001609466',\n",
       "        '-40.63335164906105', ..., '54.31228077099648', '123.0',\n",
       "        'Sinus_Tachycardia'],\n",
       "       ['-14.299994121880898', '-12.951280481990485',\n",
       "        '-11.416985294399705', ..., '14.764532947005735', '123.0',\n",
       "        'Sinus_Tachycardia'],\n",
       "       ['0.0', '0.0', '0.0', ..., '0.0', '123.0', 'Sinus_Tachycardia'],\n",
       "       ...,\n",
       "       ['-15.00218762655504', '-13.176144880710474',\n",
       "        '-11.256069088311921', ..., '34.55045611154739', '123.0',\n",
       "        'Sinus_Tachycardia'],\n",
       "       ['-3.9269471638104085', '-4.477020922562214',\n",
       "        '-4.846829608520115', ..., '22.714660699953154', '123.0',\n",
       "        'Sinus_Tachycardia'],\n",
       "       ['-16.29128183523312', '-14.2946982583345', '-12.115651880793529',\n",
       "        ..., '29.797783843492336', '123.0', 'Sinus_Tachycardia']],\n",
       "      dtype='<U32')"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [],
   "source": [
    "NonRepDiagnosisDF = FullDiagnosisDF.loc[~FullDiagnosisDF['FileName'].isin(RepDiagnosisDF['FileName'])]\n",
    "NonRepDiagnosisDF = NonRepDiagnosisDF.reset_index(drop=True)\n",
    "NonRepDiagnosisDF['PatientID'] = NonRepDiagnosisDF['FileName']\n",
    "\n",
    "AllDiagnosisDF = pd.concat([RepDiagnosisDF, NonRepDiagnosisDF])\n",
    "AllDiagnosisDF = AllDiagnosisDF.reset_index(drop=True)\n",
    "le = preprocessing.LabelEncoder()\n",
    "AllDiagnosisDF['PatientID'] = AllDiagnosisDF['PatientID'].astype('str')\n",
    "AllDiagnosisDF['PatientID'] = le.fit_transform(AllDiagnosisDF['PatientID'])\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/anaconda3/lib/python3.7/site-packages/joblib/externals/loky/process_executor.py:691: UserWarning: A worker stopped while some jobs were given to the executor. This can be caused by a too short worker timeout or by a memory leak.\n",
      "  \"timeout or by a memory leak.\", UserWarning\n"
     ]
    }
   ],
   "source": [
    "\n",
    "num_cores =6\n",
    "   \n",
    "\n",
    "results = Parallel(n_jobs=num_cores)(delayed(generate_12lead_input_for_NN)\n",
    "            (AllDiagnosisDF['PatientID'][indexFile],AllDiagnosisDF['Translation'][indexFile],signalFile) for indexFile, signalFile in enumerate(AllDiagnosisDF['FileName']))\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "\n",
    "# Save to CSV file.\n",
    "outfn = root_path+'/FeatureArray_stacked_pcs.csv'\n",
    "print('Generating ', outfn)\n",
    "with open(outfn, \"wb\") as fin:\n",
    "    np.savetxt(fin, FeatureArray3, delimiter=\",\", fmt='%f')\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "len(results)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "def split_train_test(patient_rows):\n",
    "    random_rows=np.random.choice(patient_rows.shape[0], size=2, replace=False)\n",
    "    test=patient_rows[random_rows,:,:]\n",
    "    train=np.delete(patient_rows,random_rows,0)\n",
    "    return train,test\n",
    "\n",
    "train,test = map(list,zip(*[split_train_test(i) for i in results if  i.any()]))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "print(len(train))\n",
    "print(len(test))\n",
    "num_of_people_in_data=len(train)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "train_stacked = np.row_stack(train)\n",
    "test_stacked = np.row_stack(test)\n",
    "\n",
    "print('train beats: '+str(train_stacked.shape))\n",
    "print('test beats: '+str(test_stacked.shape))\n",
    "print('total number of beats: '+str(train_stacked.shape[0]+test_stacked.shape[0]))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "train_X=train_stacked[:,:,:-2]\n",
    "train_y=train_stacked[:,:,-2]\n",
    "train_diagnosis=train_stacked[:,:,-1]\n",
    "\n",
    "test_X=test_stacked[:,:,:-2]\n",
    "test_y=test_stacked[:,:,-2]\n",
    "test_diagnosis=train_stacked[:,:,-1]\n",
    "\n",
    "\n",
    "print('train_X: '+str(train_X.shape))\n",
    "print('train_y: '+str(train_y.shape))\n",
    "print('train_diagnosis: '+str(train_diagnosis.shape))\n",
    "\n",
    "\n",
    "print('test_X: '+str(test_X.shape))\n",
    "print('test_X: '+str(test_y.shape))\n",
    "print('test_diagnosis: '+str(test_diagnosis.shape))\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "\n",
    "# reshaping to 2D array so that npsavetxt can save it\n",
    "outfn = root_path+'/nn-input/train_X.csv'\n",
    "with open(outfn, \"wb\") as fin:\n",
    "    np.savetxt(fin, train_X.reshape((train_X.shape[0],12*300)), delimiter=\",\", fmt='%f')\n",
    "\n",
    "\n",
    "# Save to CSV file.\n",
    "outfn = root_path+'/nn-input/train_y.csv'\n",
    "with open(outfn, \"wb\") as fin:\n",
    "    np.savetxt(fin, train_y, delimiter=\",\", fmt='%f')\n",
    "\n",
    "\n",
    "# Save to CSV file.\n",
    "outfn = root_path+'/nn-input/test_X.csv'\n",
    "with open(outfn, \"wb\") as fin:\n",
    "    np.savetxt(fin, test_X.reshape((test_X.shape[0],12*300)), delimiter=\",\", fmt='%f')\n",
    "\n",
    "    \n",
    "\n",
    "# Save to CSV file.\n",
    "outfn = root_path+'/nn-input/test_y.csv'\n",
    "with open(outfn, \"wb\") as fin:\n",
    "    np.savetxt(fin, test_y, delimiter=\",\", fmt='%f')\n",
    "    \n",
    "\n",
    "\n",
    "# Save to CSV file.\n",
    "outfn = root_path+'/nn-input/test_diagnosis.csv'\n",
    "with open(outfn, \"wb\") as fin:\n",
    "    np.savetxt(fin, test_diagnosis, delimiter=\",\", fmt='%f')\n",
    "    \n",
    "    \n",
    "\n",
    "\n",
    "# Save to CSV file.\n",
    "outfn = root_path+'/nn-input/train_diagnosis.csv'\n",
    "with open(outfn, \"wb\") as fin:\n",
    "    np.savetxt(fin, train_diagnosis, delimiter=\",\", fmt='%f')\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
